package 第八章.ScheduledThreadPoolExecutor_9;

import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Run3 {
	@SuppressWarnings("rawtypes")
	public static void main(String[] args) throws InterruptedException {
		ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(10);
		Runnable runnable1 = new MyRunnable("A");
		ScheduledFuture future = executor.schedule(runnable1, 0, TimeUnit.SECONDS);
		Thread.sleep(3000);
		System.out.println(future.cancel(true));
		System.out.println("main end!");
	}
}
